package com.kly.cashmall.popup;

import android.content.Context;
import android.graphics.Paint;
import android.text.SpannableString;
import android.util.TypedValue;
import android.view.View;
import android.widget.TextView;


import com.kly.cashmall.R;

import razerdp.basepopup.BasePopupWindow;

public class OrganizationDetailsPopup extends BasePopupWindow {

    private TextView popup_confirm;
    private TextView popup_title;
    private TextView popup_url;

    public OrganizationDetailsPopup(Context context) {
        super(context);
        setContentView(R.layout.popup_organization_details);
        popup_confirm = findViewById(R.id.popup_confirm);
        popup_title = findViewById(R.id.popup_title);
        popup_url = findViewById(R.id.popup_url);
        popup_url.getPaint().setFlags(Paint. UNDERLINE_TEXT_FLAG );

    }

    public void setConfirmClick(View.OnClickListener listener) {
        getContentView().findViewById(R.id.popup_confirm).setOnClickListener(listener);
    }

    public void setUrlClick(View.OnClickListener listener) {
        getContentView().findViewById(R.id.popup_url).setOnClickListener(listener);
    }

    public void setConfirmText(String text) {
        popup_confirm.setText(text);
    }

    public void setTitleText(SpannableString text) {
        popup_title.setText(text);
    }

    public void setUrlText(String text) {
        popup_url.setText(text);
    }

    public void setTitleTextSize(int size) {
        popup_title.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
    }

}
